package com.jy.wms.web;

import com.joyi.gate.comm.SessionInfo;
import com.jy.wms.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
//@RequestMapping("")
public class LoginRouter {
    @Autowired
    LoginService loginService;

    @RequestMapping(value = {"/login","/"})
    public String toLogin(HttpSession session){
        System.out.println("login");
        if(session.getAttribute(SessionInfo.USER)!=null){
            return "forward:/index";
        }else {
            return "login";
        }
    }
}
